import { BaseAvatar } from "./BaseAvatar";
import { SEntityInfo } from "../../../../Message/BroadCast/SEntityInfo";
import { ImagesConst } from "../../resource/ImagesConst";
type int = number;
//class NPCAvatar
    
    export  class NPCAvatar extends BaseAvatar
    {
        constructor(arg1: SEntityInfo)
        {
            super(arg1);
            return;
        }

        public /* override */ init(): void
        {
            this.isShowHealthLabelTip = false;
            this.isShowManaLabelTip = false;
            this.isShowHealthText = false;
            this.isShowManaText = false;
            this.entityInfo.life = 100;
            this.entityInfo.maxLife = 100;
            this.entityInfo.mana = 100;
            this.entityInfo.maxMana = 100;
            super.init();
            levelLabel.text = "N";
            this.resetAvatar();
            return;
        }

        public resetAvatar(): void
        {
            mainBgName = ImagesConst.AimAvatarBg_green;
            healthBar.setSize(95, 8);
            healthBar.progressBarClass = ImagesConst.Shengmingtiao;
            magicBar.setSize(95, 8);
            magicBar.progressBarClass = ImagesConst.Mofatiao;
            this.updateAvatar(entityInfo.code);
            this.resetPosition();
            return;
        }

        public /* override */ updateAvatarUI(arg1: SEntityInfo): void
        {
            entityInfo = arg1;
            nameLabel.text = arg1.name;
            this.updateAvatar(arg1.code);
            return;
        }

        /* internal  */updateAvatar(arg1: int): void
        {
            avatarName = arg1 + ".png";
            return;
        }

        public resetPosition(): void
        {
            avatarBitmap.x = 9;
            avatarBitmap.y = 5;
            levelLabel.x = 17;
            levelLabel.y = 40;
            nameLabel.x = 65;
            nameLabel.y = 0;
            healthBar.move(68, 20);
            magicBar.move(68, 29);
            return;
        }

        /* internal */ /* var */_avatarName: string="";
    }
